package com.hakim.wfb.customer.enums;

/**
 * 订单状态
 * Created by caochong on 2016/6/13.
 */
public enum OrderStatus {
    WAIT_TICKET("1", "wait_ticket"),//等待出票
    TICKET_SUCCESS("2", "ticket_success"),//出票成功
    TICKET_FAILED("3", "ticket_failed"),//出票失败
    REFUNDING("4", "refunding"),//退票中
    REFUND_SUCCESS("5", "refund_success"),//退票成功
    REFUND_FAILED("6", "refund_failed"),//退票失败
    REVERSE_SUCCESS("7", "reverse_success"),//冲正成功
    ;

    private String code;

    private String message;

    private OrderStatus(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    public static OrderStatus getByCode(String code) {
        OrderStatus[] codes = values();
        for (OrderStatus each : codes) {
            if (each.code.equals(code)) {
                return each;
            }
        }
        return null;
    }
}
